Derivatives problem 18.mws

1. Graphing solutions to differential equations.

We illustrate how to use Maple to solve differential equations. Consider the differential equation:

> deq:=D(y)(x)=x*ln(x);

deq := D(y)(x) = x*ln(x)

To solve this differential equation in Maple, we type the following command.

> dsolve(deq);

y(x) = 1/2*x^2*ln(x)-1/4*x^2+_C1

Notice that the undetermined constant is denoted by _C1, instead of C. This is done by Maple in order to pick a name for the constant that is not likely to conflict with constants that you may have defined elsewhere. To find a solution with a specific value of the constant, we substitute:

> subs(_C1=3,dsolve(deq));

y(x) = 1/2*x^2*ln(x)-1/4*x^2+3

In order to use the plot command to plot this function, we need to extract the right hand side of the equation above.

> func:=rhs(subs(_C1=3,dsolve(deq)));

func := 1/2*x^2*ln(x)-1/4*x^2+3

> plot(func,x=1..4);

[Maple Plot]

Suppose that we want to plot a whole sequence of these functions at once. Then we can use the seq command to create a collection of different solutions as follows:

> expr:=rhs(dsolve(deq));

expr := 1/2*x^2*ln(x)-1/4*x^2+_C1

> funcs:=seq(subs(_C1=k,expr),k=-2..2);

funcs := 1/2*x^2*ln(x)-1/4*x^2-2, 1/2*x^2*ln(x)-1/4...

> plot([funcs],x=1..4);

[Maple Plot]

It is easy to see from the picture above that all of these different solutions differ by a constant. Next, let us determine a solution which satisfies some specific condition. To find the solution which passes through the point ( 2, 5 ), we substute x=2 and y=5 into the general solution, and solve for the constant _C1.

> subs(y(x)=5,x=2,dsolve(deq));

5 = 2*ln(2)-1+_C1

> solve(%,_C1);

6-2*ln(2)

> subs(_C1=6-2*ln(2),dsolve(deq));

y(x) = 1/2*x^2*ln(x)-1/4*x^2+6-2*ln(2)

> plot(rhs(%),x=1..4);

[Maple Plot]

Submission:

For each of the following differential equations:

(a) Find the solution containing the arbitrary constant C .

(b) Graph the solutions for C = -2, -1, 0, 1, 2 on the same set of axes.

(c) Find and graph the solution that passes through the specified point P(x[0],y[0]) over the given interval [a,b].

  1. y' = x*sqrt(1-x) , [ 0, 1 ] , P(1/2,1)

  2. y' = 1/x , [ 1, 4 ] , P(2,-1)

  3. y' = x*sin(x) , [ -4, 4 ], P(Pi,-1)

  4. y' = 1/(1+sin(x)) , [ -Pi/2, Pi/2 ] , P(0,1)

Submission worksheet:

 

2. Solutions to Autonomous differential equations.

An autonomous differential equation is one of the form  D(y) = f(y)where f is some function. It is called autonomous because the right hand side depends only on the dependent variable y , and not on the independent variable.

An example of a differential equation which is not autonomous is D(y)(x) = 2*x , which we know how to solve exactly. The general solution is given by y = x^2+C , where C is an arbitrary constant.  On the other hand, the differential equation D(y) = ky is an autonomous differential equation, which we already know how to solve. It has general solution y(x) = C*exp(k*y) , where C is an arbitrary constant. Note that the equilibrium solution for this differential equation is y = 0 , and we can easily plot the phase line for the solution. By differentiating the differential equation above to find `@@`(D,2)(y) , we see that it is given by `@@`(D,2)(y) = k^2*y , which means that the solutions for which y is positive are always concave up, and those solutions for which y is negative are always concave down.

A more complicated example is given by the autonomous differential equation below, which has two equilibrium solutions, y = 1 and y = 3 .

> deq:=D(y)=(y-1)*(y-3);

deq := D(y) = (y-1)*(y-3)

By differentiating this differential equation, we find that

> D(deq);

`@@`(D,2)(y) = D(y)*(y-3)+(y-1)*D(y)

> factor(%);

`@@`(D,2)(y) = 2*D(y)*(y-2)

so that any solution which crosses the line y = 2 has an inflection point there. Notice that the second derivative also vanishes at the points where D(y) = 0 , which are not inflection points on the graph. The sign of D(y) must be taken into account when determining the concavity of the solution. Thus we have the following decomposition, which will enable us to construct the phase line and understand the graphs of the solutions easily:

When y is in the interval ( -infinity, 1 ) 0 < D(y) and y-2 < 0 , so `@@`(D,2)(y) < 0 , and the curve is concave down and the function is increasing.

When y is in the interval ( 1, 2 ), D(y) < 0 and y-2 < 0 , so 0 < `@@`(D,2)(y) and the curve is concave up and the function is decreasing.  When y is in the interval ( 2, 3 ), D(y) < 0 and 0 < y-2 , so `@@`(D,2)(y) < 0 and the curve is concave down and the function is decreasing.  When y is in the interval ( 3, infinity ), 0 < D(y) and 0 < y-2 , so `@@`(D,2)(y) < 0 and the curve is concave up and the function is increasing.  Let us illustrate how the solution look by using Maple to plot some solutions to this differential equation. To do this, first load the differential equations package by executing the command below.

> with(DEtools):

Warning, the name translate has been redefined

Next, we are going to plot some solutions corresponding to various initial conditions. The non equilibrium solutions come in three basic forms, those for which y<1, those for which 1<y and y<2, and those for which y>2. Let us define some initial conditions for Maple to use to plot some solutions.

> initcond:=[[y(0)=0],[y(0)=0.5],[y(0)=1.25],[y(0)=1.5],[y(0)=2.5],[y(0)=2.75],[y(0)=3.5],[y(0)=4]];

initcond := [[y(0) = 0], [y(0) = .5], [y(0) = 1.25]...

We will use these initial conditions to plot various solutions using the DEplot command. In order to use Maple's differential equation plotter, it is necessary to tell Maple that y is a function of some independent variable. Thus we need to modify the description of the differential equation, replacing y with y(x) in the differential equation above.

> deq:=D(y)(x)=(y(x)-1)*(y(x)-3);

deq := D(y)(x) = (y(x)-1)*(y(x)-3)

> DEplot(deq,y(x),x=-2..2,initcond,y=-0..5,linecolor=blue);

[Maple Plot]

Notice that the curves which pass through the line y = 2 all have an inflection point there. You may notice that there are no relative extrema in any of the solutions. This is a general property of autonomous differential equations.  From the picture, it is very easy to see that y = 1 is a stable equilibrium and y = 2 is an unstable equilibrium.

Submission:

For the differential equation D(P) = 3*P*(1-P)*(2-P) :

(a) Make a table showing the intervals on which the function is increasing and is concave up or down, as was done in the example. You will need to find where the derivative is equal to zero, as well as where the second derivative is equal to zero in order to determine this.

(b) Use the DEplot command to plot solution curves for the differential equation. Plot at least one curve in each interval between equilibrium solutions. Use the independent variable t.

(c) Determine the stable and unstable equilibria.

Submission worksheet:

 

3. The Logistic curve.

The differential equation D(X) = k*X*(N-X) shows up in many applications. It can be used to describe the notion of social diffusion , e.g. the spreading of information. We can divide a population into two classes, those that have the information and those that do not. It is reasonable to assume that the spread of information would be proportional to the product of those that have the information and those that do not. This differential equation describes exactly that situation. The differential equation is given by

> deq:=D(X)(t) = k*X(t)*(N-X(t));

deq := D(X)(t) = k*X(t)*(N-X(t))

In this activity, we discuss how to solve the differential equation exactly, rather than graphically, using Maple's differential equation solving capabilities. Let us solve it explicitly.

> dsolve(deq,X(t));

X(t) = N/(1+exp(-N*k*t)*_C1*N)

Note that the solution involves an arbitrary constant _C1, which is determined by the initial condition X(0) = X[0] . We could either solve for the constant, or we could put the initial condition into the dsolve command as follows.

> dsolve({deq,X(0)=C},X(t));

X(t) = N/(1+exp(-N*k*t)*(N-C)/C)

Submission:

Suppose that a rumor spreads at UWEC, and that the differential equation in the example above models how the rumor spreads. If there are N = 10000 students at UWEC, and at time t = 0 weeks, exactly X(0) = 2 people are aware of the rumor, then find the exact solution for the problem, assuming that k = .1e-2 . Plot your solution and use your graph to estimate how many weeks it will take for all students to be aware of the rumor. At what time is the rumor spreading the most rapidly? How many students know the rumor at this time?

Submission worksheet:

 

4. Strength of a Beam.

The strength of a beam is proportional to the width of the beam times the square of its depth. In other words, if we let S represent the strength, d the depth and w the width, then S = k*w*d^2 , where 0 < k is some constant of proportionality.  Let us begin by finding the dimensions of the strongest beam that can be cut from a 12 in diameter cylindrical log. Note that we can always cut a rectangle of dimension w times d as long as w^2+d^2 = 144 . This allows us to express S as a function of one variable. In this case we can solve the problem easily if we use w as the independent variable, because we then have the simple formula for S ,

> S:=w->k*w*(144-w^2);

S := proc (w) options operator, arrow; k*w*(144-w^2...

Note that the feasible domain for the problem is 0..12. Also, at the endpoints, it is clear that S = 0 . Thus we should look for the place where the derivative is equal to zero.

> solve(D(S)(w)=0,w);

4*sqrt(3), -4*sqrt(3)

Let us apply the second derivative test at w = 4*sqrt(3) to show that it corresponds to a local maximum.

> (D@@2)(S)(4*sqrt(3));

-24*k*sqrt(3)

Since 0 < k , this is a local maximum because the curve is concave down at this point.  In order to graph this function, we need to choose a value for the proportionality constant. Let us assume k = 1 . and then plot the resulting curve.

> k:=1;plot(S,1..12);

k := 1

[Maple Plot]

Notice that the maximum occurs at exactly w = 4*sqrt(3) , which is approximately 6.928203232 . The maximum strength is approximately

> evalf(S(4*sqrt(3)));

665.1075103

We could also have expressed S as a function of the depth d , which would result in a different formula, and a different graph, but the value for the maximum would remain the same. Let us verify this.

> S:=d->k*sqrt(144-d^2)*d^2;

S := proc (d) options operator, arrow; k*sqrt(144-d...

> S(d);

sqrt(144-d^2)*d^2

> solve(D(S)(d)=0);

0, 4*sqrt(6), -4*sqrt(6)

> evalf(S(4*sqrt(6)));

665.1075103

> plot(S,0..12);

[Maple Plot]

Let us plot the curve for S in terms of d , for some various values of k .

> k:='k';

k := 'k'

> curves:=seq(k*sqrt(144-d^2)*d^2,k=1..4);

curves := sqrt(144-d^2)*d^2, 2*sqrt(144-d^2)*d^2, 3...

> plot([curves],d=0..12);

[Maple Plot]

Notice that though the maximum value of S depends on k , it reaches its maximum value at the same value of d no matter what the value of k is.

Submission:

Consider a log that is 1 meter (100 cm.) in diameter.

(a) Find the dimensions of the strongest beam that can be cut from the 100 cm. diameter log.

(b) Graph the strength, S , as a function of the beam's width w, assuming the proportionality constant to be k=1 .

Reconcile what you see with your answer in part (a).

(c) Now graph the strength, S, as a function of the beam's width d . (What is the point of this exercise?)  Graph S using several values for k , say k = 1, 1/2, 1/3, 1/4 .

Submission worksheet: